﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FreeGoo.GameEngine.Renderables;
using FreeGoo.GameEngine.Renderables.Particles;

namespace FreeGoo.LevelClasses.LevelParts.Particles
{
    public abstract class LevelPartParticle : BodyRenderableLevelPart
    {
        public abstract Particle BuildParticle(Level level, System.Xml.Linq.XElement element);

        public override BodyRenderable BuildBodyRenderable(Level level, System.Xml.Linq.XElement element)
        {
            Particle particle = BuildParticle(level, element);
            particle.IsSleeping = element.Attribute("Sleeping").ToBool(false);
            particle.LinkableDistanceLinkBias = element.Attribute("LinkableDistanceLinkBias").ToFloat(particle.LinkableDistanceLinkBias * 100.0f) / 100.0f;
            return particle;
        }
    }
}
